package com.zhu.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhu.domain.InventoryRecordItem;
import com.zhu.mapper.InventoryRecordItemMapper;
import com.zhu.model.inventoryRecordItem.InventoryRecordItemSelectVM;
import com.zhu.service.InventoryRecordItemService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author JoyBoy
 * @since 2022-06-02
 */
@Service
public class InventoryRecordItemServiceImpl extends ServiceImpl<InventoryRecordItemMapper, InventoryRecordItem> implements InventoryRecordItemService {

    @Override
    public boolean saveInventoryRecordItem(InventoryRecordItem inventoryRecordItem) {
        return this.save(inventoryRecordItem);
    }

    @Override
    public boolean saveList(List<InventoryRecordItem> inventoryRecordItemList) {
        return this.saveBatch(inventoryRecordItemList);
    }

    @Override
    public boolean deleteRecordItem(Integer recordItemId) {
        return this.removeById(recordItemId);
    }

    @Override
    public List<InventoryRecordItemSelectVM> getByRelevance(Integer recordId) {
        return this.getBaseMapper().getByRelevance(recordId);
    }

    @Override
    public InventoryRecordItem getByInventoryRecordItemId(Integer inventoryRecordItemId) {
        return this.getById(inventoryRecordItemId);
    }

    @Override
    public boolean updateInventoryRecordItem(InventoryRecordItem inventoryRecordItem) {
        return this.updateById(inventoryRecordItem);
    }

}
